//
//  Select_scopeTableViewCell.m
//  fxxiaoke
//
//  Created by 鞠超 on 16/9/17.
//  Copyright © 2016年 jc. All rights reserved.
//

#import "Select_scopeTableViewCell.h"

@implementation Select_scopeTableViewCell

- (instancetype )initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if(self)
    {
        [self p_setupView];
    }
    
    return self;
}

- (void )p_setupView
{
    self.image_department = [[UIImageView alloc] init];
    self.image_department.layer.cornerRadius = 22.5;
    self.image_department.layer.masksToBounds = YES;
    self.image_department.image = [UIImage imageNamed:@"Department.png"];
    [self.contentView addSubview:self.image_department];
    
    self.name_department = [[UILabel alloc] init];
    self.name_department.textColor = [UIColor blackColor];
    self.name_department.font = [UIFont systemFontOfSize:16];
    [self.contentView addSubview:self.name_department];
    
    self.department_number = [[UILabel alloc] init];
    self.department_number.textColor = [UIColor grayColor];
    self.department_number.font = [UIFont systemFontOfSize:14];
    [self.contentView addSubview:self.department_number];
    
    self.view_Line = [[UIView alloc] init];
    self.view_Line.backgroundColor = [UIColor groupTableViewBackgroundColor];
    [self.contentView addSubview:self.view_Line];
    
    self.btn_delete = [UIButton buttonWithType:(UIButtonTypeCustom)];
    [self.btn_delete setBackgroundImage:[UIImage imageNamed:@"Delete.png"] forState:(UIControlStateNormal)];
    [self.contentView addSubview:self.btn_delete];
}

- (void )layoutSubviews
{
    [super layoutSubviews];
    
    self.image_department.frame = CGRectMake(15, 7.5, 45, 45);
    
    self.name_department.frame = CGRectMake(CGRectGetMaxX(self.image_department.frame) + 10, 10, SCREEN_WIDTH - CGRectGetMaxX(self.image_department.frame) - 60, 20);
    
    self.department_number.frame = CGRectMake(CGRectGetMaxX(self.image_department.frame) + 10, CGRectGetMaxY(self.name_department.frame) + 5, SCREEN_WIDTH - CGRectGetMaxX(self.image_department.frame) - 60, 15);
    
    self.view_Line.frame = CGRectMake(CGRectGetMaxX(self.image_department.frame) + 10, 59, SCREEN_WIDTH - CGRectGetMaxX(self.image_department.frame) - 10, 1);
    
    self.btn_delete.frame = CGRectMake(SCREEN_WIDTH - 10 - 30, 15, 30, 30);
}

@end
